class Solution {
public:
    int singleNumber(vector<int>& nums) {
        sort(nums.begin(),nums.end());
        auto it=nums.begin();
        while(it+1 != nums.end()){
            if(  *it!=*(it+1)){
                return *it;
            }
            it+=3;
        }
        return *it;
    }
};
